#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>

using namespace std;

int main()
{
	string word;
	cin >> word;
	int arr[27] = { 0 };
	int k = 0;
	for (int i = 0; i < word.size(); i++) {
		if (word[i] >= 97) {
			arr[word[i] - 97]++;
		}
		else {
			if (arr[word[i] - 97+32]) {
				k++;
			}
		}
	}
	cout << k;
	return 0;
}
//a 97;	 z 122;  A 65;  Z 90